/*
 * JaCoLiB
 * Copyright (C) 2008 Alessandro Serra
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package it.gashale.jacolib.shell;

import it.gashale.jacolib.console.ConsoleInterface;
import it.gashale.jacolib.console.StandardIOConsole;
import it.gashale.jacolib.core.JacolibError;


public abstract class LocalShell implements ShellInterface {
	public static ConsoleInterface default_console=new StandardIOConsole();

	private String m_language_name;
	private ConsoleInterface m_console;
	
	protected LocalShell(String language_name) throws JacolibError {
		m_language_name=language_name;
		m_console=default_console;
	}
	public String getLanguageName() {
		return m_language_name;
	}
	public ConsoleInterface getConsole() {
		return m_console;
	}
	public void setConsole(ConsoleInterface con) throws JacolibError {
		m_console=con;
		notify_new_console();
	}
	protected void notify_new_console() throws JacolibError {
	}
	
	public String hello() {
		return "Hello! I'm a "+getLanguageName()+"~A shell.";
	}
}
